package com.zz.tijian.handle.mq;

import com.zz.tijian.handle.mq.dto.PayMQDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class PayProducer {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendPayMessage(PayMQDto payMQDto) {
        //TODO 后续开启消息发送确认机制
        rabbitTemplate.convertAndSend(RabbitMQConfig.PAY_EXCHANGE, RabbitMQConfig.PAY_ROUTING_KEY, payMQDto);
    }

}
